﻿<div>
	<hr/>
	<div class="form-inline">
		<div class="form-group">
			<a href="#/" class="btn btn-link">返回相册</a>
			<label for="albumName">相册名称</label>
			<input type="text" ng-readonly="readonly" ng-init="readonly=true" ng-click="readonly=false" class="form-control" id="albumName" placeholder="输入相册名称" ng-model="albumName" ng-keyup="editAlbum($event)"/>
			
		</div>
		<div class="form-group">
			<input type="button" value="删除" class="btn btn-danger" ng-click="deleteAlbum()" />
			<a class="btn btn-primary" ng-trigger>上传图片</a>
			<input id="selectFile" type="file" ng-file="files" />
		</div>
	</div>
	<!-- modal -->
	<div ng-if="newPic" class="modal fade" ng-class="{in:newPic}">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close" ng-click="closePreview()">
                        <span aria-hidden="true">&times;</span>
                    </button>
					<h4 class="modal-title">预览</h4>
				</div>
				<div class="modal-body">
				    <div style="max-height: 300px; overflow: auto;">
                        <a class="confirm" data-result="{{newPic.linkurl}}" href="javascript:void(0)" target="_blank">
                            <img ng-src="{{newPic.linkurl}}" style="max-width: 100%; margin: 0 auto; display: block;" />
                        </a>
				    </div>
				</div>
				<div class="modal-footer">
				    <button type="button" class="btn btn-primary confirm" data-result="{{newPic.linkurl}}" data-dismiss="modal">选择</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="closePreview()">关闭</button>
				</div>
			</div>
		</div>
	</div>
	<!-- /.modal -->
	<hr/>
	<div ng-if="loading">
		<div class="progress">
			<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"
			style="width: 100%"></div>
		</div>
	</div>
	<div ng-if="picInfo">
		<div class="row">
			<div class="col-lg-2 col-md-3 col-sm-4 col-xs-6" ng-repeat="pic in picInfo.pic">
				<div class="thumbnail">
				    <a class="confirm" data-result="{{pic.linkurl}}" href="javascript:void(0)" target="_blank">
                        <img ng-src="{{pic.linkurl}}" />
                    </a>
					<div class="caption clearfix">
					    <div ng-bind="pic.name" class="pull-left name"></div>
					    <div class="pull-right">
                            <a href="javascript:void(0)" class="text-primary " ng-click="preViewPic($index)">预览</a>
					        <a href="javascript:void(0)" class="text-danger" ng-click="deletePic(pic.id)">删除</a>
					    </div>
					</div>
				</div>
			</div>
		</div>
		<nav ng-if="picInfo.total>0">
			<ul class="pagination">
				<li ng-class="{disabled:1==p}">
					<a ng-if="p>1" ng-href="#/albumpic/{{aid}}/{{albumName}}/{{p-1}}" aria-label="Previous">
						<span aria-hidden="true">&laquo;</span>
					</a>
					<a ng-if="p==1" aria-label="Previous">
						<span aria-hidden="true">&laquo;</span>
					</a>
				</li>
				<li ng-repeat="i in pageArray track by $index" ng-class="{active:($index+1)==p}">
					<a ng-href="#/albumpic/{{aid}}/{{albumName}}/{{$index+1}}" ng-bind="$index+1"></a>
				</li>
				<li ng-class="{disabled:picInfo.pages==p}">
					<a ng-if="p<picInfo.pages" ng-href="#/albumpic/{{aid}}/{{albumName}}/{{p+1}}" aria-label="Next">
						<span aria-hidden="true">&raquo;</span>
					</a>
					<a ng-if="p==picInfo.pages" aria-label="Previous">
						<span aria-hidden="true">&raquo;</span>
					</a>
				</li>
			</ul>
		</nav>
	</div>
</div>